import { Modal as modal } from 'ant-design-vue';

export const Modal = {
  info(content: string, title: string = '友情提示') {
    modal.info({
      title: title,
      content: content
    });
  },
  success(content: string, title: string = '友情提示') {
    modal.success({
      title: title,
      content: content
    });
  },
  error(content: string, title: string = '友情提示') {
    modal.error({
      title: title,
      content: content
    });
  },
  warning(content: string, title: string = '警告') {
    modal.warning({
      title: title,
      content: content
    });
  },
  confirm(content: string, title: string = '友情提示', ok = null) {
    modal.confirm({
      title: title,
      content: content,
      okText: '确认',
      onOk: typeof ok === 'function' ? ok : function() {}
    });
  }
};
